<?php
/**
 *
 * @copyright Copyright (c) 2020 cleverstone
 * 
 */

namespace app\controllers;

use yii\web\Controller;

/**
 * 网站控制器继承类
 * @author cleverstone
 * @since ym1.0
 */
abstract class CommonController extends Controller
{
    /**
     * 截断所有请求
     * @param $action
     * @return bool
     * @throws \yii\base\InvalidRouteException
     * @throws \yii\web\BadRequestHttpException
     */
    public function beforeAction($action)
    {
        if (parent::beforeAction($action)) {
            \Yii::$app->response->redirect('/admin');
        }

        return false;
    }
}